package com.nineclock.system.feign;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCompanyUserDTO;
import com.nineclock.system.dto.SysUserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author 黑马程序员
 * @Company http://www.ithiema.com
 * @Version 1.0
 */
@FeignClient("sys-service")
public interface SysUserFeign {
    //**************************直接导入********************************
    @GetMapping("/user/query")
    public Result<SysUserDTO> queryUser(@RequestParam("username") String username);

    /**
     * 在feign接口中 get请求，所有的参数都必须加 @RequestParam
     * @param companyId
     * @param userId
     * @return
     */
    @GetMapping("/companyUser/query")
    public Result<List<SysCompanyUserDTO>> queryCompanyUser(
            @RequestParam(value = "companyId", required = false) Long companyId,
            @RequestParam(value = "userId", required = false) Long userId);

    //**************************直接导入********************************
}
